import { createApp } from 'vue'
import { createPinia } from 'pinia'

/* pinia 持久化插件 */
import piniaPluginPersist from 'pinia-plugin-persist'
import App from './App.vue'
import router from './router'

/* Arco */
import ArcoVue from '@arco-design/web-vue';
import '@arco-design/web-vue/dist/arco.css';

/* View Design */
import ViewUIPlus from 'view-ui-plus'
import 'view-ui-plus/dist/styles/viewuiplus.css'

/* Echars */
import echarts from './util/echarts';

/* ElementPlus */
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ELIcons from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
/* css */
import './assets/main.css'

const store = createPinia()
store.use(piniaPluginPersist)

const app = createApp(App)
for (let iconName in ELIcons) {
  app.component(iconName, ELIcons[iconName])
}

app.config.globalProperties.$echarts = echarts
app.use(ElementPlus, {
  locale: zhCn,
})
app.use(ArcoVue)
app.use(store)
app.use(router)
app.use(ElementPlus)
app.use(ViewUIPlus)
app.mount('#app')